<#import "/spring.ftl" as spring />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="
<@spring.url "/js/jquery/jquery-ui.css" />" rel="stylesheet"
type="text/css" />
<script type="text/javascript" src="<@spring.url"/js/jquery/jquery.js"/>"></script>
<script type="text/javascript" src="<@spring.url"/js/jquery/jquery-ui.js"/>"></script>
<script type="text/javascript" src="<@spring.url"/js/ckeditor/ckeditor.js"/>"></script>
<link href="
<@spring.url "/css/memberInfo.css" />" rel="stylesheet"
type="text/css"/>
<link href="
<@spring.url "/css/mail.css" />" rel="stylesheet"
type="text/css"/>
<title>邮件编辑</title>
<script>
	$(function() {
		$(".button").button();
		$("#importAll").button();
		$("#cancel").button();
		$('#importAll').bind('click', function() {
			$.ajax( {
				type : "GET",
				url : "<@spring.url"/ajax/connect.htm"/>",
				data : "deptID=13",
				dataType : "json",
				success : function(data) {
					$("#sendTo").val(data);
				}
			});
		})
	});

	$(function() {
		$( "#connectAccordion" ).accordion({
			autoHeight: false,
			navigation: true
			});
		$('#cancel').bind('click', function() {
			$("#sendTo").val("");
		});
	});
</script>
</head>
<body>
<form action="<@spring.url"/message/sendMail.htm"/>"
method="post">
<div style="padding: 0px 10px 10px 10px">
<div style="float: left;">
<table>
	<tbody>
		<tr>
			<td>
			<table class=gridView id=ctl00_ContentPlaceHolder2_GridView1
				style="WIDTH: 100%; BORDER-COLLAPSE: collapse" cellSpacing=0
				rules=all border=1>
				<tr>
					<th class=gridViewItem scope=col>发件人:</th>
					<td class=gridViewItem width="600" align="left">
					<div align="left"><input name="sendFrom" type="text"
						size="30" value="" /></div>
					</td>
				</tr>
				<tr>
					<th class=gridViewItem scope=col>收件人:</th>
					<td class=gridViewItem>
					<div align="left"><input name="sendTo" type="text" size="30"
						value="" id="sendTo" />
					</td>
				</tr>
				<tr>
					<th class=gridViewItem scope=col>主题:</th>
					<td class=gridViewItem>
					<div align="left"><input name="title" type="text" size="30"
						value="" />
					</td>
				</tr>
				<tr>
					<th class=gridViewItem scope=col>添加附件:</th>
					<td class=gridViewItem>
					<div align="left"><input name="attachFile" type="file"
						size="30" />
					</td>
				</tr>
				<tr>
					<th class=gridViewItem scope=col>内容:</th>
					<td class=gridViewItem><textarea class="ckeditor" cols="600"
						id="content" name="content" rows="5">
                </textarea></td>
				</tr>
			</table>
			</td>
		</tr>
		<tr>
			<td>
			<div>
			<button class=button>发送</button>
			&nbsp;<a class=button href="<@spring.url"/message/editMail.htm"/>">取消</a></div>
			</td>
		</tr>
	</tbody>
</table>
</div>
<div id="accordionResizer"
	style="padding: 10px 30px 10px 10px; width: 250px; height: 220px; float: right;">
	<div id="connectAccordion">
		<h3><a href="">全部联系人</a></h3>
		<div>
			<button type="button" id="importAll" >全部导入</button>
			<button type="button" id="cancel">取消导入</button>
		</div>
		<h3><a href="">部门成员</a></h3>
		<div>
			<#assign i = 0>
			<#list members as member>
 			<a class="emailAddress" id=emailAddress_${i} title=${member.email} href="javascript:void(0)">${member.stuName}</a><br>
 			<script>
 			$(function() {
 				$('#emailAddress_${i}').bind('click', function() {
 					$("#sendTo").val($('#emailAddress_${i}').attr("title"));
 				});
 			});
			</script>
 			<#assign i = i+1>
 			</#list>
		</div>
	</div>
</div>
</div>
</form>
</body>
</html>